package com.jinlia.show.modules.wxapp.controller;

import com.alibaba.fastjson.JSON;
import com.jinlia.show.modules.base.system.service.ErrandDadaCallbackMapperService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.HashMap;

@Slf4j
@RestController
@RequiredArgsConstructor
@RequestMapping("/dada")
public class ErrandDadaCallbackListener {
    @Autowired
    private ErrandDadaCallbackMapperService errandDadaCallbackMapperService;

    @PostMapping("/callback/{id}")
    public void callbackListener(@PathVariable("id") Long id, @RequestBody HashMap<String, Object> paramMap) {

        log.info("达达快递回调id={}",id);
        log.info("达达快递回调paramMap={}", JSON.toJSONString(paramMap));
        errandDadaCallbackMapperService.callbackListener(id,paramMap);
    }
}
